<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>判断字符串中的{}、[]、()三种括号是否匹配，需要考虑嵌套的情况。</title>  
</head>

<body>
<script>
function validBraces(braces){
  while(/\(\)|\[\]|\{\}/g.test(braces)){
    braces = braces.replace(/\(\)|\[\]|\{\}/g,"")
  }
  return !braces.length;
}
console.log(validBraces("(){}[]"))     // true 
console.log(validBraces("(}"))         // false 
console.log(validBraces("[(])"))      // false 
console.log(validBraces("([{}])"))     // true 
</script>
</body>
</html>
                                